<script>
export default {
  onLaunch: function() {
    console.log('App Launch');
    
    // 初始化用户信息
    let userId = uni.getStorageSync('userId');
    if (!userId) {
      userId = 'user_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);
      uni.setStorageSync('userId', userId);
    }

    let userName = uni.getStorageSync('userName');
    if (!userName) {
      userName = '玩家' + Math.floor(Math.random() * 10000);
      uni.setStorageSync('userName', userName);
    }

    console.log('用户ID:', userId);
    console.log('用户名:', userName);
  },
  onShow: function() {
    console.log('App Show');
  },
  onHide: function() {
    console.log('App Hide');
  }
};
</script>

<style lang="scss">
/* 全局样式 */
@import '@/uni.scss';

page {
  background-color: #f5f5f5;
  font-size: 28rpx;
}

/* 通用按钮样式 */
button {
  border-radius: 8rpx;
}

button::after {
  border: none;
}

/* 输入框样式 */
input {
  font-size: 28rpx;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}
</style>
